#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int removeElement(int* nums, int numsSize, int val)
{
    int right = numsSize - 1;
    int flag = numsSize;
    for (int i = 0; i < numsSize; i++)
    {
        
        if (val == nums[i])
        {
            
            int tmp = nums[i];
            nums[i] = nums[right];
            nums[right] = tmp;
            right--;
            i--;
            flag--;
        }
        if (i == right)
        {
            break;
        }
    }
    return flag;
}
int main()
{
    int arr[] = { 3,2,2,3 };
    int len = sizeof(arr )/sizeof(arr[0]);
    int val = 3;
    int s=removeElement(arr, len, val);

    return 0;
}